home *** CD-ROM | disk | FTP | other *** search
/ Acorn User: China / Acorn User China CD-ROM (UK) (Disc B) / Acorn User China CD-ROM (UK) (Disc B).bin / STUTTGART / FROMUTS / UNIXLIB37B / test_c_unamtest < prev    next >
Encoding:
Text File  |  1992-02-24  |  270 b   |  19 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. #include "sys/unix.h"
  5.  
  6. int main()
  7. {
  8. int l;
  9. char b[81];
  10.  
  11. while (fgets(b,256,stdin))
  12.   {
  13.   l = strlen(b) - 1; if (l >= 40) l = 39; b[l] = 0;
  14.   strncpy(b + 40,__uname(b,0),39); b[80] = 0;
  15.   memset(b + l,' ',40 - l);
  16.   puts(b);
  17.   }
  18. }
  19.